import request from '../utils/request'

// 分页查询班级列表
export function getClazzList(params) {
  const requestParams = {
    pageNum: params?.pageNum || 1,
    pageSize: params?.pageSize || 10,
    clazzNo: params?.clazzNo ?? '',
    clazzName: params?.clazzName ?? '',
    grade: params?.grade ?? '',
    dept: params?.dept ?? ''
  }
  return request({
    url: '/clazz/listPage',
    method: 'get',
    params: requestParams
  })
}

// 根据id查询班级详情
export function getClazzDetail(id) {
  return request({
    url: '/clazz/select',
    method: 'get',
    params: { id }
  })
}

// 新增班级
export function addClazz(data) {
  return request({
    url: '/clazz/save',
    method: 'post',
    data
  })
}

// 编辑班级
export function updateClazz(data) {
  return request({
    url: '/clazz/update',
    method: 'put',
    data
  })
}

// 删除班级
export function deleteClazz(id) {
  return request({
    url: '/clazz/delete',
    method: 'delete',
    params: { id }
  })
}







